package com.onlyMe.config.objects.object
{
	import com.onlyMe.config.BaseNode;
	
	public final class ObjectNode extends BaseNode
	{
		private var _id:int;
		private var _type:String;
		private var _components:Array = [];
		
		public function ObjectNode()
		{
		}
		
		override protected function extract(node:XML):void
		{
			_id = node.@id;
			_type = node.localName() as String;
		}

		override protected function extractChild(node:XML):void
		{
			// For now, components will deserialize directly from XML
			//_components.push(new ComponentNode().decode(node));
			_components.push(node);
		}
		
		public function get id():int
		{
			return _id;
		}

		public function get type():String
		{
			return _type;
		}

		public function get components():Array
		{
			return _components.concat();
		}
	}
}